﻿using GM_Shop.DAL;
using GM_Shop.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GM_Shop.BLL
{
    public class LogInMethod
    {
        public CJson logIn(string name, string pwd,ref int Id)
        {
            if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(pwd)) return new CJson(2, "账号或密码为空");

            var info = new SelectData().SelectUser(new CNumberInfo() { Name = name, Password = pwd });
            if (info != null) {
                Id = info.Id;
                return new CJson(1, "登录成功");
            }
            return new CJson(0, "账号或密码错误");
        }
    }
}
